<template>
  <div>
    <!-- 标题栏 -->
    <van-nav-bar
      class="nav"
      :title="title"
      left-text="返回"
      left-arrow
      @click-left="onClickLeft"
    ></van-nav-bar>
    <div class="doctor-main">
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
export default {
  name: "doctor-index",
  watch: {
    $route: {
      handler(val) {
        const { path } = val;
        switch (path) {
          case "/doctorManage/add":
            this.title = "新增专家";
            break;
          case "/doctorManage/list":
            this.title = "专家管理列表";
            break;
          default:
            this.title = "修改专家信息";
            break;
        }
      },
      immediate: true,
      deep: true,
    },
  },
  data() {
    return {
      title: "专家管理列表",
    };
  },
  methods: {
    onClickLeft() {
      this.$router.go(-1);
    },
  },
};
</script>

<style lang="scss" scoped>
::v-deep .van-nav-bar__left {
  .van-nav-bar__text {
    color: #fff;
  }
}
::v-deep .van-nav-bar .van-icon {
  color: #fff;
}

::v-deep .van-nav-bar__title {
  color: #fff;
}
::v-depp .van-nav-bar__text {
  color: #fff !important;
}
.nav {
  background-color: #36c14c;
  span {
    color: #fff;
  }
}
.doctor-main {
  min-width: 1153px;
  width: 1153px;
  margin: 20px auto;
}
</style>
